{% import 'admin/layout.html' as layout with context -%}
{% import 'admin/static.html' as admin_static with context %}
<!DOCTYPE html>
<html>
<head>
    <title>{% block title %}{% if admin_view.category %}{{ admin_view.category }} - {% endif %}{{ admin_view.name }} -
        {{ admin_view.admin.name }}{% endblock %}</title>
    {% block head_meta %}
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">
    {% endblock %}
    <link rel="shortcut icon" href="{{ url_for('static',filename='img/favicon.ico') }}" type="image/x-icon"/>
    {% block head_css %}
        <!-- Bootstrap v3.4.1 -->
        <link href="{{ url_for('static', filename='adminlte/bower_components/bootstrap/css/bootstrap.min.css') }}"
              rel="stylesheet">
        <!-- FontAwesome v4.7.0 -->
        <link href="{{ url_for('static', filename='adminlte/bower_components/font-awesome/css/font-awesome.min.css') }}"
              rel="stylesheet">
        <!-- Ionicons v2.0.0-->
        <link href="{{ url_for('static', filename='adminlte/bower_components/Ionicons/css/ionicons.min.css') }}"
              rel="stylesheet">
        <!-- AdminLTE Theme style v2.4.18-->
        <link href="{{ url_for('static', filename='adminlte/css/AdminLTE.css') }}" rel="stylesheet">
        <!-- AdminLTE Skins -->
        <link href="{{ url_for('static', filename='adminlte/css/_all-skins.min.css') }}" rel="stylesheet">
        <!-- iCheck -->
        <link href="{{ url_for('static', filename='adminlte/plugins/iCheck/square/blue.css') }}" rel="stylesheet">
        <link href="{{ admin_static.url(filename='admin/css/bootstrap3/admin.css', v='1.1.1') }}" rel="stylesheet">
        <link href="{{ url_for('static', filename='css/common.css') }}" rel="stylesheet">
        {% if admin_view.extra_css %}
            {% for css_url in admin_view.extra_css %}
                <link href="{{ url_for('static', filename=css_url) }}" rel="stylesheet">
            {% endfor %}
        {% endif %}
    {% endblock head_css %}
    {% block head %}
    {% endblock head %}
    {% block head_tail %}
    {% endblock head_tail %}
</head>
<body class="hold-transition skin-blue sidebar-mini {% if sbc=='1' %}sidebar-collapse{% endif %}">
{% block page_body %}

    <div class="wrapper">
        <!-- Main Header -->
        <header class="main-header">
            <!-- Logo -->
            {% block brand %}
                <a href="{{ admin_view.admin.url }}" class="logo">
                    <!-- mini logo for sidebar mini 50x50 pixels -->
                    <span class="logo-mini"><b>{{ sys_nick }}</b></span>
                    <!-- logo for regular state and mobile devices -->
                    <span class="logo-lg"><b>{{ admin_view.admin.name }}</b></span>
                </a>
            {% endblock brand %}

            <!-- Header Navbar -->
            <nav class="navbar navbar-static-top" role="navigation">
                <!-- Sidebar toggle button-->
                <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                    <i id="sidebar-switch" class="fa fa-dedent"></i>
                    <span class="sr-only">Toggle navigation</span>
                </a>
                <!-- Navbar Right Menu -->
                <div class="navbar-custom-menu">
                    {% block menu_links %}
                        <ul class="nav navbar-nav navbar-right">
                            {{ layout.menu_links() }}
                        </ul>
                    {% endblock menu_links %}
                    {% block access_control %}
                    {% endblock access_control %}
                </div>
            </nav>
        </header>
        <!-- / Main Header -->
        <!-- Left side menu, contains sidebar -->
        <aside class="main-sidebar">
            <section class="sidebar">
                <!-- Sidebar Menu -->
                <ul class="sidebar-menu" data-widget="tree">
                    {% if current_user.is_authenticated %}
                        <li class="header"><!-- search form -->
                            <form action="#" method="get" class="sidebar-form">
                                <div class="input-group">
                                    <input type="text" name="q" class="form-control" placeholder="Search...">
                                    <span class="input-group-btn">
                                        <button type="submit" name="search" id="search-btn" class="btn btn-flat">
                                            <i class="fa fa-search"></i>
                                        </button>
                                    </span>
                                </div>
                            </form>
                        </li>
                        {% block main_menu %}
                            {{ layout.menu() }}
                        {% endblock main_menu %}
                    {% endif %}
                </ul>
            </section>
        </aside>
        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                {% block breadcrumb %}
                    {{ layout.breadcrumb() }}
                {% endblock breadcrumb %}
            </section>
            <!-- Main content -->
            <section class="content container-fluid">
                {% block messages %}
                    {{ layout.messages() }}
                {% endblock messages %}

                {# store the jinja2 context for form_rules rendering logic #}
                {% set render_ctx = h.resolve_ctx() %}

                {% block body %}{% endblock %}
            </section>
            <!-- / Main content -->
        </div>
        <!-- / Content Wrapper -->
    </div>

    <!-- Control Sidebar -->
    <aside class="control-sidebar control-sidebar-dark">
        <!-- Create the tabs -->
        <ul class="nav nav-tabs nav-justified control-sidebar-tabs">
            <li class="active">
                <a href="#control-sidebar-theme-tab" data-toggle="tab"><i class="fa fa-paint-brush"></i></a>
            </li>
            <li><a href="#control-sidebar-layout-tab" data-toggle="tab"><i class="fa fa-tasks"></i></a></li>
            <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
        </ul>
        <!-- Tab panes -->
        <div class="tab-content">
            <!-- Theme tab content -->
            <div class="tab-pane active" id="control-sidebar-theme-tab">
                <h4 class="control-sidebar-heading">主题皮肤</h4>
            </div>
            <!-- /.tab-pane -->
            <!-- Options tab content -->
            <div class="tab-pane" id="control-sidebar-layout-tab">
            </div>
            <!-- /.tab-pane -->
            <!-- Settings tab content -->
            <div class="tab-pane" id="control-sidebar-settings-tab">
                <form method="post">
                    <h4 class="control-sidebar-heading">通用设置</h4>

                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            操作信息收集
                            <input type="checkbox" class="pull-right" checked>
                        </label>
                        <p>
                            收集用户操作信息，以持续优化系统
                        </p>
                    </div>
                    <!-- /.form-group -->
                    <h3 class="control-sidebar-heading">在线状态设定</h3>
                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            显示为在线
                            <input type="checkbox" class="pull-right" checked>
                        </label>
                    </div>
                    <!-- /.form-group -->
                    <div class="form-group">
                        <label class="control-sidebar-subheading">
                            关闭站内消息
                            <input type="checkbox" class="pull-right">
                        </label>
                    </div>
                    <!-- /.form-group -->
                </form>
                <!-- /.tab-pane -->
            </div>
        </div>
    </aside>
    <!-- /.control-sidebar -->
    <!-- Add the sidebar's background. This div must be placed
    immediately after the control sidebar -->
    <div class="control-sidebar-bg"></div>

{% endblock page_body %}

{% block tail_js %}
    <script src="{{ admin_static.url(filename='vendor/jquery.min.js', v='3.5.1') }}" type="text/javascript"></script>
    <script src="{{ url_for('static', filename='adminlte/bower_components/bootstrap/js/bootstrap.min.js') }}"
            type="text/javascript"></script>
    <script src="{{ admin_static.url(filename='vendor/moment.min.js', v='2.22.2') }}" type="text/javascript"></script>
    <script src="{{ admin_static.url(filename='vendor/select2/select2.min.js', v='3.5.2') }}"
            type="text/javascript"></script>
    <script src="{{ admin_static.url(filename='admin/js/helpers.js', v='1.0.0') }}" type="text/javascript"></script>
    {% if admin_view.extra_js %}
        {% for js_url in admin_view.extra_js %}
            <script src="{{ url_for('static', filename=js_url) }}" type="text/javascript"></script>
        {% endfor %}
    {% endif %}
    <!-- Slimscroll -->
    <script src="{{ url_for('static', filename='adminlte/bower_components/jquery-slimscroll/jquery.slimscroll.min.js') }}"
            type="text/javascript"></script>
    <!-- FastClick -->
    <script src="{{ url_for('static', filename='adminlte/bower_components/fastclick/fastclick.js') }}"
            type="text/javascript"></script>
    <!-- AdminLTE App -->
    <script src="{{ url_for('static', filename='adminlte/adminlte.js') }}" type="text/javascript"></script>
    <!-- Demo purpose -->
    <script src="{{ url_for('static', filename='js/app.js') }}" type="text/javascript"></script>
    {% if admin_view.name=="Home" %}
        <script src="{{ url_for('static', filename='adminlte/dashboard.js') }}"></script>
    {% endif %}

{% endblock tail_js %}

{% block tail %}
{% endblock tail %}
</body>
</html>
